Skip to content

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Mar 18, 2025

This will be ff-only merged into libevm.

Each cherry-picked commit is adapted to fit in subnet-evm and to pass CI

@qdm12 qdm12 changed the base branch from master to qdm12/libevm/master-merge-1 March 18, 2025 13:32
@qdm12 qdm12 force-pushed the qdm12/libevm/coreth-sync branch 4 times, most recently from 76ba2a2 to 46717e4 Compare March 18, 2025 19:02
@qdm12 qdm12 force-pushed the qdm12/libevm/coreth-sync branch 4 times, most recently from b41a3bc to 4033f17 Compare March 19, 2025 17:49
@qdm12 qdm12 force-pushed the qdm12/libevm/master-merge-1 branch from 0e56432 to 4e746c8 Compare March 21, 2025 09:27
@qdm12 qdm12 force-pushed the qdm12/libevm/coreth-sync branch 2 times, most recently from 06ebc8e to c4a0e2a Compare March 21, 2025 12:15
Base automatically changed from qdm12/libevm/master-merge-1 to libevm March 24, 2025 10:01
@qdm12 qdm12 force-pushed the qdm12/libevm/coreth-sync branch 3 times, most recently from f6c95f9 to edf98cc Compare March 24, 2025 15:41
@qdm12 qdm12 marked this pull request as ready for review March 24, 2025 15:49
@qdm12 qdm12 requested review from a team, ceyonur and darioush as code owners March 24, 2025 15:49
Copy link
Collaborator

@ceyonur ceyonur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly nits

qdm12 and others added 17 commits April 1, 2025 10:10
- Part of the core/rawdb migration to use libevm
- Using libevm `InspectDatabase`
- Define options passed to libevm `InspectDatabase`

See original PR ava-labs/coreth#791
- Move our own code to `_ext.go` files
- Import symbols from libevm in imports.go

See original PR ava-labs/coreth#772

Co-authored-by: Arran Schlosberg <[email protected]>
- fix generation of code using type aliases and Go 1.23
- reproducible generation locally (pin gencodec version)
- CI keeps generated Go files up to date with other source code
- Generate missing files

See original PR ava-labs/coreth#856
Reduces overlap between subnet-evm and upstream files:
- Types and variables that are identical to `libevm` are moved to `imports.go`.
- Files that include only `subnet-evm` have the `_ext.go` suffix added.

See original PR ava-labs/coreth#872
These packages are unused and were just copies from the `ava-labs/libevm` repo.

See original PR ava-labs/coreth#876
Until a complete transition to a `libevm` package, it shouldn't be allowed to be imported directly.

Remove the package from the allowed list and move a `types` test into `package types_test` to avoid a circular dependency.

See original PR ava-labs/coreth#874
Complete the transition of `core/types` to upstream code.

Note that the previous commit results in _all_ upstream types / vars / consts being in the `imports.go` file. This results in a strict partition of upstream and local identifiers so it is safe to simply change import paths.

1. Globally change all imports from `subnet-evm/core/types` to `libevm/core/types`;
2. Rename all `subnet-evm/core/types` imports to `customtypes` for ease of review here;
3. Dot import `libevm/core/types` in tests only to avoid hundreds of noisy changes.

See original PR ava-labs/coreth#875
The `types` package now only contains `coreth` logic an nothing from upstream so it shouldn't live in the same location in the repo.

Automated:

```shell
$ git mv core/types plugin/evm/types
$ find -name '*.go' | xargs sed -i 's|"github.com/ava-labs/coreth/core/types"|"github.com/ava-labs/coreth/plugin/evm/types"|'
$ golangci-lint run --fix
```

See original PR ava-labs/coreth#877
- import interfaces from github.com/ava-labs/libevm directly
- import `NotFound` error from github.com/ava-labs/libevm directly
- Keep our two subnet-evm-specific interfaces at interfaces/interfaces.go

See original PR ava-labs/coreth#883
Changes applied from comments on the review of ava-labs/coreth#820

See original PR ava-labs/coreth#862

Signed-off-by: Quentin McGaw <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]>
@qdm12 qdm12 force-pushed the qdm12/libevm/coreth-sync branch from 58b3702 to 08e92ea Compare April 1, 2025 08:19
@qdm12 qdm12 added libevm and removed blocked Blocked by another issue or pull request labels Apr 1, 2025
@qdm12
Copy link
Contributor Author

qdm12 commented Apr 1, 2025

FYI there were 2 force pushes since your last approved-review:

  1. This force push with 532 additions and 877 deletions (big, but less big than the whole PR)
    • adds the following commits from coreth's libevm branch:
      • chore(rawdb): move plugin/evm/rawdb to plugin/evm/customrawdb
      • chore(interfaces): use upstream code
      • chore(types): move plugin/evm/types to plugin/evm/customtypes
      • chore(all): final changes to the libevm branch
  2. This force push rebasing on top of chore(metrics): use libevm metrics package #1508

Note force pushes are required given we will merge this PR branch with fast forward only in the libevm branch to keep its history.

@qdm12 qdm12 marked this pull request as ready for review April 1, 2025 08:29
@qdm12 qdm12 mentioned this pull request Apr 1, 2025
@qdm12 qdm12 merged commit 08e92ea into libevm Apr 1, 2025
11 checks passed
@qdm12 qdm12 deleted the qdm12/libevm/coreth-sync branch April 1, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants